package com.xinggq.common.page;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import java.util.List;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * @Description
 * @Author xinggq
 * @Date 2025/9/25
 */
@Data
@Schema(name = "公共分页条件参数")
public class PageCondition<T> {

  @Schema(description = "页码", example = "1")
  @Min(value = 1, message = "页码最小为1")
  private Integer pageNum;

  @Schema(description = "每页数据大小", example = "10")
  @Range(min = 1, max = 100, message = "每页条数范围为1-100")
  private Integer pageSize;

  @Schema(description = "排序列", example = "[\"id\"]")
  private List<String> orderByColumns;

  @Schema(description = "true倒叙排列，false正序排列，默认倒叙", example = "true")
  private Boolean isDes = true;

  @Schema(description = "搜索条件")
  private T queryDto;
}
